﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using BUS;
using DTO;
using TuyenDungViecLam.CommonResource;
namespace TuyenDungViecLam.User_control_VN
{
    public partial class Menu_NTD : System.Web.UI.UserControl
    {
        public static string ten = "";
        public static string MaNhaTuyenDung = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }

        protected void Page_PreRender(object sender, EventArgs e)
        {
            NhaTuyenDung_BUS.LayTenNhaTuyenDung(Session["UserID"].ToString(), ref ten, ref MaNhaTuyenDung);
        }

        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            //kiem tra duoc dang tin hay ko?
            int userID = int.Parse(Session["UserID"].ToString());

            int ketqua = BUS.NhaTuyenDung_BUS.KiemTraDangTin(userID);
            if (ketqua == 1)
            {
                string url = "DangTinTuyenDung.aspx?Mct=" + MaNhaTuyenDung;
                Response.Redirect(url);
            }
            else
            {
                Alert.Show("Không thể đăng tin!");
            }
        }

        protected void LinkButton2_Click(object sender, EventArgs e)
        {
            string url = "QuanLyTinTuyenDung.aspx?Mct=" + MaNhaTuyenDung;
            Response.Redirect(url);
        }

        protected void LinkButton6_Click(object sender, EventArgs e)
        {
            string url = "ThanhToan.aspx?Mct=" + MaNhaTuyenDung;
            Response.Redirect(url);
        }

        protected void LinkButton3_Click(object sender, EventArgs e)
        {
            string url = "DanhSachCV.aspx?Mct=" + MaNhaTuyenDung;
            Response.Redirect(url);
        }

        protected void LinkButton4_Click1(object sender, EventArgs e)
        {
            string url = "TimKiemCVOnline.aspx?Mct=" + MaNhaTuyenDung;
            Response.Redirect(url);
        }

        protected void LinkButton8_Click(object sender, EventArgs e)
        {
            string url = "../NhaTuyenDung/XemCVUpload.aspx";
            Response.Redirect(url);
        }
    }
}